﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Cadastro
{
    public partial class Form2 : Form
    {
        Cliente Cliente;
        List<Cliente> clientes { get; set; }

        public Form2(List<Cliente> clientes)
        {
            InitializeComponent();
            this.clientes = clientes;
        }

        private void buttonSalvar_Click(object sender, EventArgs e)
        {
            Cliente = new Cliente(textBoxNome.Text, textBoxEmail.Text, Convert.ToInt32(textBoxDDD.Text), Convert.ToInt32(textBoxTel.Text));
            this.clientes.Add(Cliente);
            MessageBox.Show("Os dados do cliente foram salvos!");
            Close();
        }
    }
}
